#define _CRT_SECURE_NO_WARNINGS 1


#include<iostream>

using namespace std;

int vis[100];
void dfs(int n, int step)
{
	if (step > n)
	{
		for (int i = 1; i <= n; i++)
		{
			if (vis[i] == 1)cout << i<<" ";
		}
		cout << endl;
		return;
	}
    //select or not select
	for(int i=1;i<=2;i++)
	{
	    vis[step]=i;
	    dfs(n,step+1);
	}
}



int main()
{
	int n; cin >> n;
	dfs(n, 1);
	return  0;
	
}
